class Solution {
public:
    int massage(vector<int>& nums) 
    {
        int num = nums.size();
        if(num == 0) return 0;

        vector<int> g(num), f(num);

        f[0] = nums[0], g[0] = 0;
        for(int i=1; i<num; i++)
        {
            f[i] = g[i-1] + nums[i];
            g[i] = max(f[i-1], g[i-1]);
        }

        return max(f[num-1], g[num-1]);
    }
};